﻿<navigation:Page x:Class="OpenRPOSBackOffice.Schedule" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="800" d:DesignHeight="480"
           Style="{StaticResource PageStyle}" Loaded="Page_Loaded"
           Title="Schedule Page">

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="70*" />
            <RowDefinition Height="381*" />
        </Grid.RowDefinitions>
        <Grid Height="70" VerticalAlignment="Top">
            <sdk:Label Height="19" HorizontalAlignment="Left" Margin="4,8,0,0" Name="lblRole" Content="Role" VerticalAlignment="Top" Width="28" />
            <ComboBox Height="27" HorizontalAlignment="Left" Margin="5,25,0,0" Name="cmbRoles" VerticalAlignment="Top" Width="155" SelectionChanged="cmbRoles_SelectionChanged" />
            <CheckBox x:Name="cbShowPreferences" Content="Show Preferences" HorizontalAlignment="Left" Margin="171,18,0,0" VerticalAlignment="Top" Checked="cbShowPreferences_Checked" Unchecked="cbShowPreferences_Unchecked" Padding="3,-3,0,0" />
            <CheckBox x:Name="cbShowNotes" Content="Show Notes" HorizontalAlignment="Left" Margin="171,39,0,0" VerticalAlignment="Top" Checked="cbShowNotes_Checked" Unchecked="cbShowNotes_Unchecked" Padding="3,-3,0,0"/>
            <Button x:Name="btnEditTemplates" Height="31" Content="Edit Templates" HorizontalAlignment="Left" Margin="312,20,0,0" VerticalAlignment="Top" Width="112" Click="btnEditTemplates_Click"/>
            <Button Content="Print" Height="31" HorizontalAlignment="Left" Margin="435,20,0,0" Name="btnPrint" VerticalAlignment="Top" Width="54" Click="btnPrint_Click" />
            <sdk:Label Height="19" HorizontalAlignment="Left" Margin="500,10,0,0" Name="lblPeriodStart" VerticalAlignment="Top" Width="70" VerticalContentAlignment="Center" Content="Period Start" />
            <sdk:DatePicker Height="23" HorizontalAlignment="Left" Margin="499,28,0,0" Name="dpPeriodStart" VerticalAlignment="Top" Width="120" SelectedDateChanged="dpPeriodStart_SelectedDateChanged" />
            <Button Content="&lt; Prev" Height="40" HorizontalAlignment="Left" Margin="631,20,0,0" Name="btnPrevPeriod" VerticalAlignment="Top" Width="60" Click="btnPrevPeriod_Click" />
            <Button Content="Next &gt;" Height="40" HorizontalAlignment="Left" Margin="696,20,0,0" Name="btnNextPeriod" VerticalAlignment="Top" Width="60" Click="btnNextPeriod_Click" />
        </Grid>
        <sdk:DataGrid Grid.Row="1" AutoGenerateColumns="False" Name="dgSchedules" VerticalAlignment="Top" FrozenColumnCount="2" HorizontalAlignment="Left" CanUserSortColumns="False" CanUserResizeColumns="False" CanUserReorderColumns="False" IsReadOnly="true" KeyDown="dgSchedules_KeyDown" MouseLeftButtonUp="dgSchedules_MouseLeftButtonUp" SelectionMode="Single" Visibility="Collapsed" LoadingRow="dgSchedules_LoadingRow">
            <sdk:DataGrid.ColumnHeaderStyle>
                <Style  TargetType="sdk:DataGridColumnHeader" >
                    <Setter Property="FontSize" Value="10" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Grid Name="Root">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="00:00:0.1" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <Rectangle x:Name="BackgroundRectangle" Stretch="Fill" Fill="#FF1F3B53" Grid.ColumnSpan="2" Grid.RowSpan="2"/>

                                    <Rectangle x:Name="BackgroundGradient" Stretch="Fill" Grid.ColumnSpan="2" Grid.RowSpan="2">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
                                                <GradientStop Color="#FFFFFFFF" Offset="0.015" />
                                                <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                <GradientStop Color="#E5FFFFFF" Offset="0.6" />
                                                <GradientStop Color="#C6FFFFFF" Offset="1" />
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>

                                    <ContentPresenter
                        Grid.RowSpan="2"
                        
                        Cursor="{TemplateBinding Cursor}"
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                        Margin="{TemplateBinding Padding}"/>

                                    <Rectangle Name="VerticalSeparator" Grid.RowSpan="2" Grid.Column="2" Width="1" VerticalAlignment="Stretch" />

                                    <Path Grid.RowSpan="2" Name="SortIcon" RenderTransformOrigin=".5,.5" HorizontalAlignment="Left" VerticalAlignment="Center" Opacity="0" Grid.Column="1" Stretch="Uniform" Width="8" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z ">
                                        <Path.Fill>
                                            <SolidColorBrush Color="#FF444444" />
                                        </Path.Fill>
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <ScaleTransform x:Name="SortIconTransform" ScaleX=".9" ScaleY=".9" />
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>

                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </sdk:DataGrid.ColumnHeaderStyle>

            <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn Header="Employee Name" IsReadOnly="True" Binding="{Binding Name}" CanUserReorder="False" CanUserResize="False" CanUserSort="False"/>
                <sdk:DataGridTextColumn x:Name="hours" Binding="{Binding Hours}"/>
                <sdk:DataGridTextColumn x:Name="day0" Binding="{Binding Day0}"/>
                <sdk:DataGridTextColumn x:Name="day1" Binding="{Binding Day1}"/>
                <sdk:DataGridTextColumn x:Name="day2" Binding="{Binding Day2}"/>
                <sdk:DataGridTextColumn x:Name="day3" Binding="{Binding Day3}"/>
                <sdk:DataGridTextColumn x:Name="day4" Binding="{Binding Day4}"/>
                <sdk:DataGridTextColumn x:Name="day5" Binding="{Binding Day5}"/>
                <sdk:DataGridTextColumn x:Name="day6" Binding="{Binding Day6}"/>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>

    </Grid>
</navigation:Page>
